package com.cloud.type;

/**
 * @author Henry.Song
 * @version 2020/12/15
 * @description
 */
public enum AlgorithmType {
    DETECT_FIRE_EXITS("1", "detect_fire_exits"),
    DETECT_FIRE_PERSON("2", "detect_fire_person"),
    DETECT_FIRE_DEHAZING("3", "detect_fire_dehazing"),
    DETECT_FIRE("4", "detect_fire"),
    DETECT_FIRE_DOOR("5", "detect_fire_door"),
    UNKNOWN("-1", "unknown");

    private final String type;
    private final String name;

    AlgorithmType(String type, String name) {
        this.type = type;
        this.name = name;
    }

    public String getType() {
        return type;
    }

    public String getName() {
        return name;
    }

    public static AlgorithmType type(String type) {
        if (DETECT_FIRE_EXITS.type.equals(type)) {
            return DETECT_FIRE_EXITS;
        } else if (DETECT_FIRE_PERSON.type.equals(type)) {
            return DETECT_FIRE_PERSON;
        } else if (DETECT_FIRE_DEHAZING.type.equals(type)) {
            return DETECT_FIRE_DEHAZING;
        } else if (DETECT_FIRE.type.equals(type)) {
            return DETECT_FIRE;
        } else if (DETECT_FIRE_DOOR.type.equals(type)) {
            return DETECT_FIRE_DOOR;
        } else {
            return UNKNOWN;
        }
    }
}
